<include file="public:header" />
    <div class="toptip link_lan">
        <div class="toptit">提示：</div>
        <p class="link_green_line">电子地图API的服务是由<a href="http://developer.baidu.com/" target="_blank">百度</a>提供，任何非盈利性网站均可使用。请参阅<a href="http://developer.baidu.com/" target="_blank">使用条款</a>获得详细信息。</p>
        <p class="link_green_line">如用于商业用途，需要同百度地图另行达成协议或获得百度地图的书面许可使用电子地图，百度地图相应的ak。 现在就去<a href="http://developer.baidu.com/" target="_blank">申请</a></p>
    </div>
<form action="{:U('config/edit')}" method="post"  name="form1" id="form1">
    <div class="toptit">电子地图设置</div>
    <div class="form_main width200">
        <div class="fl">百度地图AK：</div>
        <div class="fr">
            <input name="map_ak" id="map_ak" type="text" class="input_text_default middle" value="{:C('qscms_map_ak')}" style="color:#009900; font-weight:bold"/>
        </div>
        <div class="fl">默认中心点X坐标：</div>
        <div class="fr">
            <input name="map_center_x" id="map_center_x" type="text" class="input_text_default middle" value="{:C('qscms_map_center_x')}" style="color:#009900; font-weight:bold"/>
            <label>推动电子地图，系统将自动获取坐标</label>
        </div>
        <div class="fl">默认中心点Y坐标：</div>
        <div class="fr">
            <input name="map_center_y" id="map_center_y" type="text" class="input_text_default middle" value="{:C('qscms_map_center_y')}" style="color:#009900; font-weight:bold"/>
        </div>
        <div class="fl">默认缩放级别：</div>
        <div class="fr">
            <input name="map_zoom" id="map_zoom" type="text" class="input_text_default middle" value="{:C('qscms_map_zoom')}" style="color:#009900; font-weight:bold"/>
        </div>
        <div class="fl"></div>
        <div class="fr">
            <input type="hidden" name="type" value="map">
            <input type="submit" class="admin_submit" value="保存修改"/>
        </div>
        <div class="fl"></div>
        <div class="fr">
            <div style="width:600px;height:400px; border:1px #CCCCCC solid" id="container"></div>
        </div>
        <div class="clear"></div>
    </div>
</form>
</div>
<include file="public:footer" />
<script src="http://api.map.baidu.com/api?v=1.2" type="text/javascript"></script>
<script type="text/javascript">
  var map = new BMap.Map("container");       // 创建地图实例
  var point = new BMap.Point({:C('qscms_map_center_x')},{:C('qscms_map_center_y')});  // 创建点坐标
  map.centerAndZoom(point, {:C('qscms_map_zoom')});
  map.addControl(new BMap.NavigationControl());
  map.addEventListener("moveend", function(){
    var center = map.getCenter();
    document.getElementById("map_center_x").value=center.lng;
    document.getElementById("map_center_y").value= center.lat;
    document.getElementById("map_zoom").value=map.getZoom();
  });
</script>
</body>
</html>